home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
130 MIDI Tool Box
/
130 MIDI Tool Box.iso
/
midipeek
/
peek.txt
< prev
Wrap
Text File
|
1988-09-04
|
7KB
|
170 lines
-MIDIPEEK-
MidiPeek is a greatly expanded and improved version of my program
Peek, which first appeared in the February 1986 issue of Keyboard
magazine.
MidiPeek is a monitor for the Roland MPU-401 MIDI interface,
and equivalents (including the Voyetra OP-4001 and the Music
Quest MCC). It displays MIDI activity on the computer screen.
MidiPeek has these features:
- displays in hexadecimal, decimal, or English format.
- filters of types of MIDI messages.
- 32K buffer
- can save of buffer contents to a diskfile
- can send diskfile data over MIDI
MidiPeek can be used just by typing midipeek at a DOS prompt.
The program will ask you some terse but (I hope) self-explanatory
questions. If you need further guidance, or are curious about
MIDI internals, you may want to read the following topics.
----------------------------------------------------------------
-What's in the MIDI data stream?-
MIDI messages consist of status bytes and data bytes. The status
bytes tell what kind of data is coming next; the data bytes
following (usually one or two in number) are that data. Status
bytes always have their high bit set -- that is, their value is
equal to or greater than 128 decimal, $80 hexadecimal. Data
bytes are always less than 128 decimal, $80 hex.
Here follows a list of MIDI status bytes, with their definitions,
given in hexadecimal notation, e.g. $8n -- where $ indicates
hexadecimal, 8 is the type of status byte, and n is the MIDI
channel.
The types of message (defined by status bytes) are these:
- $8n. Note-off. 2 data bytes follow. The first byte is
the MIDI note number, the second is its off velocity.
Equipment that generates genuine note-off messages is rare.
Usually a "note-off" actually generates a "note-on" message
with velocity of zero.
- $9n. Note-on. 2 data bytes follow. First is note number,
second velocity.
- $An. Polyphonic key pressure. 2 data bytes follow. First
is note number, second is pressure data. (Rare.)
- $Bn. Continuous controller. 2 data bytes follow. First is
controller number, second is controller data. There are
many continuous controllers defined in the MIDI spec,
including sustain pedal, modulation wheel, MIDI volume
control, data sliders, and much more. Consult a recent
version of the MIDI specification for details.
- $Cn. Program (patch) change. 1 data byte follows,
specifying which of 128 possible patches will be selected.
- $Dn. Aftertouch. 1 data byte follows, giving the
instantaneous value of pressure on the keyboard. (Not all
devices send this.)
- $En. Pitch wheel. 2 data bytes follow. First is the least
significant byte of the data, second is the most significant
byte. In practice, although they send and receive both
bytes, most synthesizers ignore the first, least significant
byte.
- $Fn. System messages. A variety of little-used messages
lurk under this heading. The "n" of $Fn in this case does
not indicate the MIDI channel -- are system messages are
sent and received to all equipment regardless of channel
setting. See the MIDI spec for further details. $F0 is the
most important system message, that being "system
exclusive", the mechanism whereby remote data dumps and
parameter changes are performed.
-Display formats-
The bulk of the MidiPeek screen is given over to displaying data.
It does so in three formats: hexadecimal, decimal, and "English".
Hexadecimal is base-16, beloved of computer persons and some spec
sheets. Decimal is normal base ten. "English" translates status
bytes into their definitions as given above, and puts every
message on its own line; this format is much the easiest to read,
but suffers in terms of efficient use of screen space. (Data may
scroll off before you want it to). "English" is also somewhat
slower than the other formats, and may lose some data when
pressed (e.g. by system-exclusive or continuous controllers).
In any format, status bytes are always highlighted.
-Filtering-
MidiPeek lets you strip whole classes of data from the
display (and files). This can make the display much more
legible. For example, wind and guitar controllers generate a
great deal of continuous controller data; if you only want to
view their note-ons, you'd do well to filter the other stuff.
-Save to Disk-
MidiPeek saves the last 32,000 MIDI data bytes in its buffer,
even after they've scrolled off the screen. When you're done
viewing MIDI data, you can save the entire buffer to a disk file
if you like. MidiPeek will always ask you for a filename to save
to; if you don't want to save, just hit Return.
This is useful for two reasons. 1) If you want to view a long
session later, outside of the screen constraints of MidiPeek, you
can. MidiPeek saves MIDI data in binary format, not text format,
so you'll need a binary file viewer. Vernon Buerg's shareware
LIST program (use the Alt-H option) is highly recommended for
this purpose. 2) It can be used, in conjunction with MidiPeek's
"send" function, as a crude generic librarian for system-
exclusive data. You can dump a patch, or a bank, to MidiPeek,
save it to disk, and then later restore it using "send". (Note:
it's possible to overrun MidiPeek's capacities in terms of speed
and storage. This function is an added "goodie", not an
intrinsic, robust part of the program. It works with my
equipment, but may or may not work on yours. And it won't work
on equipment that plays handshaking tricks with system-exclusive,
such as the Casio CZ series. A reliable generic librarian,
MidiSave, is available from Carter Scholz for $15.)
-Send-
Reciprocates the "save" function, by sending out everything in a
specified disk file over MIDI. No timing information is stored;
it all goes out at speed. That is, if there are note-ons in the
file, they'll all sound at once.
-----------------------------------------
--MINIPEEK--
MiniPeek is a stripped-down version of MidiPeek. It's a smaller
file, and it runs faster. It doesn't allow filtering, or
selection of display format: everything is displayed in hex. It
doesn't allow saves or sends. Its advantage is that it asks no
questions -- if you just want a quick, raw, hex display of all
MIDI data, you may want to use this.
--MPU.PAS--
This file contains the primitives for the MPU-401. Note that no
checking is done for the MPU's presence in this version. If your
system doesn't have this MIDI interface connected when you run
either PEEK, your computer will hang.
--REGISTRATION--
The $15 shareware fee entitles you to upgrades, printed docs, and
so forth.
------------------------------------------
Carter Scholz
2665 Virginia St.
Berkeley CA 94709
...{hplabs/dual/glacier/seismo/lll-crg}!well!csz
well!csz@ucbvax.berkeley.edu